package com.parking.mgr.useraccount.service;


import com.parking.mgr.common.pojo.login.LoginUserInfo;
import com.parking.mgr.useraccount.model.param.SysLoginParam;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName AuthService
 * @Description 认证相关service
 * @Auther: zhijianpu
 * @Date: 2023/5/24
 */
public interface AuthService {


    /**
     * 生成clientId
     * @return
     */
    String createClientId(HttpServletRequest request);

    /**
     * 账号密码登录
     *
     * @param sysLoginParam
     * @param request
     * @return
     */
    String login(SysLoginParam sysLoginParam, HttpServletRequest request);

    /**
     * 退出登录
     */
    String logout(HttpServletRequest request);

    /**
     * 从request获取token 迁移到工具类
     *
     * @param request
     * @return
     */
    //String getTokenFromRequest(HttpServletRequest request);

    /**
     * 设置SpringSecurityContext上下文，方便获取用户
     *
     * @param loginUserInfo 当前登录用户信息
     */
    void setSpringSecurityContextAuthentication(LoginUserInfo loginUserInfo);

    String logoutByTokenClientId(String loginToken, String clientId);

}
